<div id="main_block_children_category">
    <div class="title_item">
	<?php
	    if(!empty($category->parent_id))
		echo CHtml::link($category->title,Yii::app()->controller->createUrl('/category/index',array('category_id' => trim($category->parent_id),'category_title' => trim($category->title))));
	    else
		echo $category->title;
	?>
    </div>
    <?php if(!empty($children_categories)){
	    foreach ($children_categories as $one){ 
    ?>
		<div class="one_category_parent">
		    <?php
			$class = '';
			if(!empty($active_category) && $active_category->id == $one->id ){
			    $class = 'active';
			}
		    ?>
		    <div class="one_category <?=$class?>">
			<?=CHtml::link($one->title,Yii::app()->controller->createUrl('/category/index',array('category_id' => trim($one->id),'category_title' => trim($one->title))));?>
		    </div>
		</div>
    <?php }} ?>
</div>